Skip to main content

Color Class

Description:

  Provides methods for creating Color objects.

__call

Type: Metamethod.

Description:

  Creates a color with all channels set to 0.

Signature:

metamethod __call: function(self: ColorClass): Color

Returns:

Return TypeDescription
ColorA new Color object.

__call

Type: Metamethod.

Description:

  Creates a new Color object with a Color3 object and alpha value.

Signature:

metamethod __call: function(self: ColorClass, color: Color3, a: integer): Color

Parameters:

ParameterTypeDescription
colorColor3The color as a Color3 object.
ainteger[optional] The alpha value of the color ranging from 0 to 255.

Returns:

Return TypeDescription
ColorA new Color object.

__call

Type: Metamethod.

Description:

  Creates a new Color object from an ARGB integer value.

Signature:

metamethod __call: function(self: ColorClass, argb: integer): Color

Parameters:

ParameterTypeDescription
argbintegerThe ARGB integer value to create the color from.For example 0xffffffff (opaque white), 0x88ff0000 (half transparent red)

Returns:

Return TypeDescription
ColorA new Color object.

__call

Type: Metamethod.

Description:

  Creates a new Color object from RGBA color channel values.

Signature:

metamethod __call: function(self: ColorClass, r: integer, g: integer, b: integer, a: integer): Color

Parameters:

ParameterTypeDescription
rintegerThe red channel value (0-255).
gintegerThe green channel value (0-255).
bintegerThe blue channel value (0-255).
aintegerThe alpha channel value (0-255).

Returns:

Return TypeDescription
ColorA new Color object.